package com.xtm.exercise.mq;

import com.xtm.common.controller.ResultController;
import com.xtm.common.model.Result;
import com.xtm.exercise.mq.base.IMQService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;

@ResultController
@RequiredArgsConstructor
@Api(tags = "演示示例", value = "演示消息的使用")
public class MQController {

    private final IMQService rocketMQService;

    @GetMapping(value = "/string/tests")
    @ApiOperation(value = "字符串消息测试")
    public Result<?> stringTest () {
        rocketMQService.stringTest();
        return Result.ok("字符串消息请求处理完成");
    }

    @GetMapping(value = "/integer/tests")
    @ApiOperation(value = "数字消息测试")
    public Result<?> integerTest () {
        rocketMQService.integerTest();
        return Result.ok("数字消息请求处理完成");
    }

    @GetMapping(value = "/object/tests")
    @ApiOperation(value = "对象消息测试")
    public Result<?> objectTest () {
        rocketMQService.objectTest();
        return Result.ok("对象消息请求处理完成");
    }

}
